package com.example.upload.api;


import com.example.upload.dto.FileUploadRequest;
import com.example.upload.dto.FilesUploadRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


import java.util.List;

@FeignClient(name = "upload-service")
public interface UploadClient {
    /* @PostMapping("/uploadFiles")
     List<String> uploadFiles(@RequestPart byte[] files, @RequestParam("path") String path);
 */
    @PostMapping(value = "/uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String uploadFile(@RequestPart MultipartFile file, @RequestParam("path") String path);

    @PostMapping(value = "/uploadBytes", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String uploadFiles(@RequestPart("bytes") byte[] bytes, @RequestParam("path") String path);

}
